package com.beyond.trace.dy.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.beyond.trace.dy.mapper.TraceDyRecordMapper;
import com.beyond.trace.dy.domain.TraceDyRecord;
import com.beyond.trace.dy.service.ITraceDyRecordService;

/**
 * 产品事件记录Service业务层处理
 * 
 * @author Mr.Yao
 * @date 2022-04-08
 */
@Service
public class TraceDyRecordServiceImpl extends ServiceImpl<TraceDyRecordMapper, TraceDyRecord> implements ITraceDyRecordService
{
    @Resource
    private TraceDyRecordMapper traceDyRecordMapper;

    /**
     * 查询产品事件记录
     * 
     * @param recordId 产品事件记录ID
     * @return 产品事件记录
     */
    @Override
    public TraceDyRecord selectTraceDyRecordById(Long recordId)
    {
        return traceDyRecordMapper.selectTraceDyRecordById(recordId);
    }

    /**
     * 查询产品事件记录列表
     * 
     * @param traceDyRecord 产品事件记录
     * @return 产品事件记录
     */
    @Override
    public List<TraceDyRecord> selectTraceDyRecordList(TraceDyRecord traceDyRecord)
    {
        return traceDyRecordMapper.selectTraceDyRecordList(traceDyRecord);
    }

    /**
     * 新增产品事件记录
     * 
     * @param traceDyRecord 产品事件记录
     * @return 结果
     */
    @Override
    public boolean insertTraceDyRecord(TraceDyRecord traceDyRecord)
    {
        traceDyRecord.setCreateTime(DateUtils.getNowDate());
        //return traceDyRecordMapper.insertTraceDyRecord(traceDyRecord);
        return super.save(traceDyRecord);
    }

    /**
     * 修改产品事件记录
     * 
     * @param traceDyRecord 产品事件记录
     * @return 结果
     */
    @Override
    public int updateTraceDyRecord(TraceDyRecord traceDyRecord)
    {
        traceDyRecord.setUpdateTime(DateUtils.getNowDate());
        return traceDyRecordMapper.updateTraceDyRecord(traceDyRecord);
    }

    /**
     * 批量删除产品事件记录
     * 
     * @param recordIds 需要删除的产品事件记录ID
     * @return 结果
     */
    @Override
    public int deleteTraceDyRecordByIds(Long[] recordIds)
    {
        return traceDyRecordMapper.deleteTraceDyRecordByIds(recordIds);
    }

    /**
     * 删除产品事件记录信息
     * 
     * @param recordId 产品事件记录ID
     * @return 结果
     */
    @Override
    public int deleteTraceDyRecordById(Long recordId)
    {
        return traceDyRecordMapper.deleteTraceDyRecordById(recordId);
    }
}
